//
//  YeeShopCarBottomView.m
//  YeeShopProject
//
//  Created by CoderYee on 2017/3/9.
//  Copyright © 2017年 CoderYee. All rights reserved.
//

#import "YeeShopCarBottomView.h"

@implementation YeeShopCarBottomView


-(instancetype)initWithFrame:(CGRect)frame
{
    
    if (self=[super initWithFrame:frame])
    {
      
        [self addOwnView];
    }
    
    return self;
}
-(void)addOwnView
{
    
    _selectedButton=[UIButton buttonWithType:UIButtonTypeCustom];
    [_selectedButton setImage:[[UIImage imageNamed:@"icon_zhifenda_xuanzhong"] imageWithTintColor:kNavBarThemeColor] forState:UIControlStateSelected];
    [_selectedButton setImage:[UIImage imageNamed:@"icon_zhifenda_weixuanzhong"]  forState:UIControlStateNormal];
    [_selectedButton setTitleColor:kBlackColor forState:UIControlStateNormal];
    [_selectedButton setTitle:@"全选" forState:UIControlStateNormal];
    _selectedButton.titleLabel.font=[UIFont Y_systemFontOfSize:13];
    _selectedButton.imageEdgeInsets=UIEdgeInsetsMake(12, 0, 11, 53);
    _selectedButton.titleEdgeInsets=UIEdgeInsetsMake(0, -40, 0, 0);
    [self addSubview:_selectedButton];
    [_selectedButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self).with.offset(5.0f);
        make.height.mas_equalTo(40);
        make.width.mas_equalTo(70);
    }];
    
    _payButton=[UIButton buttonWithType:UIButtonTypeCustom];
    _payButton.titleLabel.font=[UIFont Y_systemFontOfSize:12];
    [_payButton setBackgroundImage:[UIImage imageWithColor:kGrayColor] forState:UIControlStateDisabled];
    [_payButton setBackgroundImage:[UIImage imageWithColor:kNavBarThemeColor] forState:UIControlStateNormal];
    [_payButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
    [_payButton setTitle:@"结算(10000)" forState:UIControlStateNormal];
    [self addSubview:_payButton];
    [_payButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.equalTo(self);
        make.width.mas_equalTo(80);
    }];
    
    _couponLable=[[UILabel alloc] init];
    _couponLable.font=[UIFont Y_systemFontOfSize:11];
    _couponLable.textColor=kGrayColor;
    _couponLable.text=@"已经优惠:￥0 金额说明>";
    [self addSubview:_couponLable];
    [_couponLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(15);
        make.right.equalTo(_payButton.mas_left).offset(-10);
        make.bottom.equalTo(self).with.offset(-5);
    }];
    
    _priceLable=[[UILabel alloc] init];
    _priceLable.font=[UIFont Y_systemFontOfSize:14];
    _priceLable.textColor=kNavBarThemeColor;
    _priceLable.text=@"￥100";
    [self addSubview:_priceLable];
    [_priceLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(21);
        make.right.equalTo(_payButton.mas_left).offset(-10);
        make.top.equalTo(self);
    }];
    
    UILabel *deslable=[[UILabel alloc] init];
    deslable.font=[UIFont Y_systemFontOfSize:11];
    deslable.textColor=kGrayColor;
    deslable.text=@"合计:";
    [self addSubview:deslable];
    [deslable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(15);
        make.right.equalTo(_priceLable.mas_left).offset(-5);
        make.centerY.equalTo(_priceLable.mas_centerY);
    }];


}
//绑定
-(void)bindViewModel
{
    
    
  //把多种信号结合,map
   // RAC(_payButton,enabled)=[RACSignal combineLatest:<#(nonnull id<NSFastEnumeration>)#> reduce:<#^id _Nullable(void)reduceBlock#>];
    
    
    
}
@end
